/**
 * 
 */
package smpl.auth.google;

import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;


/**
 * @author managanesh
 *
 */
public class UserDetailsService implements org.acegisecurity.userdetails.UserDetailsService{

	private final Logger log=Logger.getLogger("smpl.UserDetailService");

	public UserAuthentication authentication;

	public UserAuthentication getAuthentication() {
		return authentication;
	}

	/* (non-Javadoc)
	 * @see org.acegisecurity.userdetails.UserDetailsService#loadUserByUsername(java.lang.String)
	 */
	public UserDetails loadUserByUsername(String arg0)
	throws UsernameNotFoundException, DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	public void performAuthentication(){
		log.debug("UserDetailsService.performAuthentication Start");

		authentication.init(new AuthRecord());
		authentication.doAuthentication();

		log.debug("UserDetailService.performAuthentication End");


	}

	public void setAuthentication(UserAuthentication authentication) {
		this.authentication = authentication;
	}

}
